package com.zhouyu;

import com.zhouyu.common.URL;
import com.zhouyu.protocol.HttpServer;
import com.zhouyu.register.LocalRegister;
import com.zhouyu.register.MapRemoteRegister;

public class Provider {
    public static void main(String[] args) {

        LocalRegister.regist(HelloService.class.getName(),"1.0", HelloServiceImpl.class);
        LocalRegister.regist(HelloService.class.getName(),"2.0", HelloServiceImpl2.class);

        // 注册中心注册
        URL url = new URL("localhost", 8080);
        MapRemoteRegister.regist(HelloService.class.getName(), url);

        // Netty, Tomcat
        HttpServer httpServer = new HttpServer();
        httpServer.start(url.getHostname(), url.getPort());

    }
}
